package appconfig

import (
	"github.com/spf13/viper"
	"log"
)

type AppConfig struct {
	MysqlConfig
}

type MysqlConfig struct {
	Host     string
	Post     int
	User     string
	Password string
	DataBase string
}

var AppConf AppConfig

func Init() {
	viper.SetConfigFile("./appconfig/config.yaml")
	viper.ReadInConfig()
	viper.Unmarshal(&AppConf)

	log.Println("动态加载配置文件:", AppConf)
}
